package com.lyw.enums;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.List;

/**
 * 方向
 */
public enum DirectionEnum {

    TOP(0, KeyEvent.VK_UP), RIGHT(1, KeyEvent.VK_RIGHT), BOTTOM(2, KeyEvent.VK_DOWN), LEFT(3, KeyEvent.VK_LEFT);

    int val;
    int keyCode;

    DirectionEnum(int val, int keyCode) {
        this.val = val;
        this.keyCode = keyCode;
    }

    public int getKeyCode() {
        return keyCode;
    }

    public void setKeyCode(int keyCode) {
        this.keyCode = keyCode;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public boolean equals(DirectionEnum e) {
        return this.val == e.val && this.keyCode == e.keyCode;
    }
}